/*
 * CacheEntry.h
 *
 *  Created on: Jan 3, 2009
 *      Author: sez
 */

#ifndef CACHEENTRY_H_
#define CACHEENTRY_H_

class CharacterData;
class Feat;
class Power;
class Race;
class Trait;
class ClassDetails;

class CacheEntry {
public:
	enum CacheEntryType
	{
		UNKNOWN_ENTRY,
		CHARACTER_ENTRY,
		CLASS_ENTRY,
		FEAT_ENTRY,
		POWER_ENTRY,
		RACE_ENTRY,
		TRAIT_ENTRY
	};
	CacheEntry();
	CacheEntry(CharacterData *characterData);
	CacheEntry(ClassDetails *classDetails);
	CacheEntry(Feat *feat);
	CacheEntry(Power *power);
	CacheEntry(Race *race);
	CacheEntry(Trait *trait);
	virtual ~CacheEntry();
	CacheEntryType type() const { return mType; }
	CharacterData *toCharacter() { return mCharacter; }
	ClassDetails *toClass() { return mClass; }
	Feat *toFeat() { return mFeat; }
	Power *toPower() { return mPower; }
	Race *toRace() { return mRace; }
	Trait *toTrait() { return mTrait; }
private:
	CacheEntryType mType;
	CharacterData *mCharacter;
	ClassDetails *mClass;
	Feat *mFeat;
	Power *mPower;
	Race *mRace;
	Trait *mTrait;
};

#endif /* CACHEENTRY_H_ */
